*
* @todo Move and rewrite code to an Action class
*
- * See design.txt for an overview.
* Note: edit user interface and cache support functions have been
* moved to separate EditPage and HTMLFileCache classes.
*/
* [[MediaWiki:Talkpagetext]]. For Article::view().
*/
public function showNamespaceHeader() {
- if ( $this->getTitle()->isTalkPage() ) {
- if ( !wfMessage( 'talkpageheader' )->isDisabled() ) {
- $this->getContext()->getOutput()->wrapWikiMsg(
- "<div class=\"mw-talkpageheader\">\n$1\n</div>",
- [ 'talkpageheader' ]
- );
- }
+ if ( $this->getTitle()->isTalkPage() && !wfMessage( 'talkpageheader' )->isDisabled() ) {
+ $this->getContext()->getOutput()->wrapWikiMsg(
+ "<div class=\"mw-talkpageheader\">\n$1\n</div>",
+ [ 'talkpageheader' ]
+ );
}
}
// HTML maxlength uses "UTF-16 code units", which means that characters outside BMP
// (e.g. emojis) count for two each. This limit is overridden in JS to instead count
- // Unicode codepoints (or 255 UTF-8 bytes for old schema).
- $conf = $this->getContext()->getConfig();
- $oldCommentSchema = $conf->get( 'CommentTableSchemaMigrationStage' ) === MIGRATION_OLD;
+ // Unicode codepoints.
$fields[] = new OOUI\FieldLayout(
new OOUI\TextInputWidget( [
'name' => 'wpReason',
'inputId' => 'wpReason',
'tabIndex' => 2,
- 'maxLength' => $oldCommentSchema ? 255 : CommentStore::COMMENT_CHARACTER_LIMIT,
+ 'maxLength' => CommentStore::COMMENT_CHARACTER_LIMIT,
'infusable' => true,
'value' => $reason,
'autofocus' => true,
* @see WikiPage::setTimestamp
*/
public function setTimestamp( $ts ) {
- return $this->mPage->setTimestamp( $ts );
+ $this->mPage->setTimestamp( $ts );
}
/**
* @return array
*/
public function doRollback( $fromP, $summary, $token, $bot, &$resultDetails, User $user = null ) {
- $user = is_null( $user ) ? $this->getContext()->getUser() : $user;
+ if ( !$user ) {
+ $user = $this->getContext()->getUser();
+ }
+
return $this->mPage->doRollback( $fromP, $summary, $token, $bot, $resultDetails, $user );
}
* @return array
*/
public function commitRollback( $fromP, $summary, $bot, &$resultDetails, User $guser = null ) {
- $guser = is_null( $guser ) ? $this->getContext()->getUser() : $guser;
+ if ( !$guser ) {
+ $guser = $this->getContext()->getUser();
+ }
+
return $this->mPage->commitRollback( $fromP, $summary, $bot, $resultDetails, $guser );
}